#_*_coding:utf-8_*_
__author__ = 'alex'


class MyClass(object):
    age = 22
    def __init__(self):
        self.name = "alex"
    def sayhi(self):#必须实例化才能调用
        print "---sayhi 1"
    @staticmethod
    def sayhi2(): #静态方法，跟类没甚么关系，不需要实例化即可调用，类的工具包
        print "---sayhi 2"
    @classmethod
    def sayhi3(self):#不需要实例化即可调用,不能访问实例数据
        print "---sayhi 3",self.age,self.name
    @property #将函数变成静态属性
    def sayhi4(self):
        print "---sayhi 4",self.name
        return 'test'

m = MyClass()
print m.sayhi4
#m.sayhi3()
#MyClass.sayhi3()
